<?php
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group([
    'prefix' => 'user',
    'middleware' => 'api',
    'namespace' => 'Api\V1_0_1'
], function() {
    //文案
    Route::post('word_press', 'UserController@wordPress');
    //图库
    Route::post('gallery', 'GalleryController@gallery');
    //app版本升级
    Route::post('app_version_upgrades', 'UserController@appVersionUpgrades');
    //获取时间
    Route::get('time', 'UserController@getTime');
    //手机号码是否存在
    Route::post('mobile_is_exists', 'UserController@findMobileIsExists');
    //注册
    Route::post('register', 'UserController@register');
    //忘记密码
    Route::post('forget_password', 'UserController@forgetPassword');
    //登录
    Route::post('login', 'UserController@login');
    //获取短信验证码
    Route::post('verification_codes', 'UserController@verificationCode');
});

Route::group([
    'prefix' => 'user',
    'middleware' => 'auth:api',
    'namespace' => 'Api\V1_0_1'
], function() {
    //获取用户信息
    Route::post('get_user_info', 'AuthController@getUserInfo');
    //退出登录
    Route::delete('logout', 'AuthController@logout');
    //修改登录密码
    Route::post('modify_login_password', 'AuthController@modifyPassword');
    //修改支付密码
    Route::post('modify_pay_password', 'AuthController@modifyPayPassword');
    //忘记支付密码
    Route::post('forget_pay_password', 'AuthController@forgetPayPassword');
    //修改头像
    Route::post('modify_head_pic', 'AuthController@modifyHeadImage');
    //身份证实名认证与银行卡信息认证
    Route::post('truename_auth', 'IdentityController@identityAuth');
    //上传身份信息图片
    Route::post('upload_identity_pic', 'IdentityController@identityUpload');
});

Route::group([
    'prefix' => 'card',
    'middleware' => 'auth:api',
    'namespace' => 'Api\V1_0_1'
], function() {
    //信用卡列表
    Route::post('credit_card_list', 'CreditCardController@creditCardList');
    //账单明细
    Route::post('credit_card_bill_detail', 'CreditCardController@creditCardBillDetail');
    //还款记录
    Route::post('credit_card_repayment_record', 'CreditCardController@creditCardRepaymentRecord');
});

Route::group([
    'prefix' => 'card',
    'middleware' => ['auth:api', 'truename_auth'],
    'namespace' => 'Api\V1_0_1'
], function() {
    //添加绑定储蓄卡
    Route::post('bank_card_add', 'IdentityController@bindBankCard');
    //储蓄卡列表
    Route::post('bank_card_list', 'BankCardController@bankCardList');
    //解绑储蓄卡
    Route::post('bank_card_unbind', 'BankCardController@unbindBankCard');
    //设置储蓄卡默认
    Route::post('bank_card_default', 'BankCardController@defaultBankCard');
    //添加绑定信用卡
    Route::post('credit_card_add', 'IdentityController@bindCreditCard');
    //修改信用卡
    Route::post('credit_card_edit', 'CreditCardController@updateCreditCard');
    //解绑或删除信用卡
    Route::post('credit_card_unbindordel', 'CreditCardController@destroyCreditCard');
    //更新账单状态
    Route::post('credit_card_bill_status', 'CreditCardController@updateBillStatus');
});


Route::group([
    'prefix' => 'repayment',
    'middleware' => ['auth:api', 'truename_auth'],
    'namespace' => 'Api\V1_0_1'
], function() {
    //还款设置
    Route::post('repayment_set', 'RepaymentBillController@repaymentBillSet');
    //推荐天数
    Route::post('recommend_days', 'RepaymentBillController@recommendDays');
    //生成还款账单
    Route::post('make_repayment_bill', 'RepaymentBillController@makeRepaymentBill');
    //提交还款计划
    Route::post('confirm_repayment_plan', 'RepaymentPlanController@confirmRepaymentPlan');
    //还款计划明细
    Route::post('repayment_plan_detail', 'RepaymentPlanController@repaymentPlanDetail');
    //停止还款计划状态
    Route::post('repayment_plan_stop', 'RepaymentPlanController@updatePlanStatusToStop');
});

Route::group([
    'prefix' => 'account',
    'middleware' => ['auth:api', 'truename_auth'],
    'namespace' => 'Api\V1_0_1'
], function() {
    //账户余额
    Route::post('account_balance', 'PersonalAccountController@accountBalance');
    //账户余额提现
    Route::post('withdraw', 'PersonalAccountController@withdraw');
    //交易明细
    Route::post('trade_detail', 'PersonalAccountController@tradeDetail');
    //收益明细
    Route::post('profit_detail', 'PersonalAccountController@profitDetail');
});

Route::group([
    'prefix' => 'member',
    'middleware' => ['auth:api', 'truename_auth'],
    'namespace' => 'Api\V1_0_1'
], function() {
    //会员升级
    Route::post('member_upgrade', 'MemberUpgradeController@memberUpgradePay');
});

Route::group([
    'prefix' => 'repayment_account',
    'middleware' => ['auth:api', 'truename_auth'],
    'namespace' => 'Api\V1_0_1'
], function() {
    //还款金账户余额
    Route::post('repayment_account_balance', 'RepaymentAccountWithdrawController@accountBalance');
    //还款金账户提现
    Route::post('withdraw', 'RepaymentAccountWithdrawController@withdraw');
    //交易明细
    Route::post('trade_detail', 'RepaymentAccountWithdrawController@tradeDetail');
});

//邀请
Route::group([
    'prefix' => 'invited',
    'middleware' => ['auth:api', 'truename_auth'],
    'namespace' => 'Api\V1_0_1'
], function() {
    //直接或间接的邀请
    Route::post('invited_number', 'InvitedController@invitedNumber');
    //直接的被邀请人
    Route::post('direct_be_invited', 'InvitedController@directBeInvited');
});

//收银
Route::group([
    'prefix' => 'collect_money',
    'middleware' => ['auth:api', 'truename_auth'],
    'namespace' => 'Api\V1_0_1'
], function() {
    //获取收银费率
    Route::post('get_fee', 'CollectMoneyController@getFee');
    //收银
    Route::post('withdraw', 'CollectMoneyController@withdraw');
    //交易记录
    Route::post('trade_record', 'CollectMoneyController@tradeRecord');
    //支持的银行列表
    Route::post('get_support_bank_list', 'CollectMoneyController@getSupportBankList');
});